# -*- coding:UTF-8 -*-#

'''
@author: qianwp
'''
import time

base_ts = time.mktime((2012, 1, 1, 0, 0, 0,0,0,0))

def timestamp():
    return long((time.time() - base_ts) * 1000)

def formatDate(timef):
    if timef is None:timef = time.time()
    return time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(timef))

def date2timef(dt):
    return time.mktime(dt.timetuple())

